﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>循环签标</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="winchm_template_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_content').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_content').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_content').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_content').style.width = 'auto';
document.getElementById('winchm_template_content').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;
</script>
</head>

<body>

<div id="winchm_template_top">
<table width="100%" height="50" bgcolor="#c4d0f4" style="WIDTH: 100%" cellSpacing=0 cellPadding=3 border=0>
<tr>
<td>
<div id="winchm_template_navigation"><EM>New&nbsp;Help 
      &gt;&nbsp;</EM>循环签标 </div>
<div id="winchm_template_title">
循环签标</div>
</td>
<td align="right" style="WIDTH: 90px">
<IMG alt=Previous src="btn_prev_n.gif"><IMG alt=Next src="btn_next_n.gif">
</td>
</tr>
</table>
</div>
<div id="winchm_template_content">
<DIV 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; COLOR: rgb(0,0,205)"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">循环签标</STRONG></SPAN></DIV>
<DIV style="BOX-SIZING: border-box">&nbsp;</DIV>
<DIV style="BOX-SIZING: border-box"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">标签作用</STRONG>：访问集合里的所有对象</DIV>
<DIV style="BOX-SIZING: border-box">&nbsp;</DIV>
<DIV style="BOX-SIZING: border-box"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">书写格式</STRONG>：$foreach(迭代对象名称 
in 集合名称)<BR style="BOX-SIZING: border-box">&nbsp;　　　　　循环体<BR 
style="BOX-SIZING: border-box">&nbsp;　　　　　$end</DIV>
<DIV style="BOX-SIZING: border-box">&nbsp;</DIV>
<DIV style="BOX-SIZING: border-box"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">注意事项</STRONG>：<BR 
style="BOX-SIZING: border-box">&nbsp;　　　　　 
1.集合名称只能是一个已经在模板引擎后台或前台定义(set)的集合（变量）的名称！<BR 
style="BOX-SIZING: border-box">&nbsp;　　　　　 2.循环标签可以无限嵌套，使用时应避免死循环<BR 
style="BOX-SIZING: border-box">&nbsp;　　　　　 3.在循环体内使用赋值标签进行赋值的变量，只能在循环体内访问!</DIV>
<DIV style="BOX-SIZING: border-box">&nbsp;</DIV>
<DIV style="BOX-SIZING: border-box"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">示例代码</STRONG>：</DIV>
<DIV style="BOX-SIZING: border-box">&nbsp;</DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　模板：</SPAN></DIV>
<DIV style="BOX-SIZING: border-box">
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　&lt;ul&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　$foreach(model 
in list)</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　&lt;li&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　&lt;dl&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　　　&lt;dt&gt;$model.Title&lt;/dt&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　　　$set(item=getChild(model.ID))<SPAN 
class=Apple-converted-space>&nbsp;</SPAN><SPAN 
style="BOX-SIZING: border-box; COLOR: rgb(0,128,0)">//创建一个新对象item，该对象在循环结束后也将不存在,getChild 
是一个访法标签，调用后台方法获取一个子对象列表</SPAN></SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　　　$foreach(node 
in item) &nbsp;<SPAN style="BOX-SIZING: border-box; COLOR: rgb(0,128,0)">//嵌套循环 
注意：不能直接这么写foreach(node in getChild(model.ID))</SPAN></SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　　　&lt;dd&gt;&lt;a 
href="news.aspx?id=$node.ID"&gt;$node.Title&lt;/dd&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　　　$end</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　　　&lt;/dl&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　　　&lt;/li&gt;</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　$end</SPAN></DIV>
<DIV style="BOX-SIZING: border-box"><SPAN 
style="BOX-SIZING: border-box; BACKGROUND-COLOR: rgb(240,248,255)">　　　　　　　　&lt;/ul&gt;</SPAN></DIV></DIV></DIV>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">　　　　后台代码略</P>
<hr>
  <font face="Arial" color="#808080" size="1">Copyright 2003-2012 Your company 
  name</font>(Edit the text to change this template.)</div>

</body>

</html>
